package com.healthlink.appcloudcalllib.utils;

import android.Manifest;
import android.app.Activity;
import android.content.Context;
import android.content.pm.PackageManager;

import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;

public class CommonUtil {
    private static final int PERMISSION_REQ_ID = 22;
    private static final String[] REQUESTED_PERMISSIONS = {
            Manifest.permission.RECORD_AUDIO,
            Manifest.permission.CAMERA
    };
    public static String token="";
    public static boolean isDebug=true;
    public static boolean showLog=false;
    public static boolean checkSelfPermission(Context context) {
      String permission=REQUESTED_PERMISSIONS[0];
        if (ContextCompat.checkSelfPermission(context, permission) !=
                PackageManager.PERMISSION_GRANTED) {
            try {
                ActivityCompat.requestPermissions((Activity) context, REQUESTED_PERMISSIONS, 101);
            }catch (Exception exception){

            }
            return false;
        }
        return true;
    }
}
